<?php	
class Configuration
{
	/*********************************************************************************\
	*	constructor de la clase
	\*********************************************************************************/
	function Configuration(){}
		
	/*********************************************************************************\
	*	Función encargada de actualizar la configuración del sitio.
	*	sebastián_lara
	*	13.JUNIO.2011
	\*********************************************************************************/
	function updateConfiguration($data){	
		$sql = "UPDATE configuration SET 
				conf_email_release_pending = '".$data->conf_email_release_pending."',				
				conf_signature='".$data->conf_signature."',
				conf_currency_us='".$data->conf_currency_us."',
				conf_currency_bol='".$data->conf_currency_bol."';";
		
		if(mysql_query($sql))
		    return true;
		else{
			securityMasterUnlock(56,1,$sql);
			return false;
		}	
	}
	
	/*********************************************************************************\
	*	Función encargada obtener la configuración del sitio.
	*	sebastián_lara
	*	13.JUNIO.2011
	\*********************************************************************************/
	function getConfiguration(){
		$sql = "SELECT c.conf_email_release_pending, c.conf_signature, c.conf_currency_us, c.conf_currency_bol FROM configuration c;";
		if($result = mysql_query($sql)){
			$row = mysql_fetch_array($result);
			
			$data->conf_email_release_pending = $row["conf_email_release_pending"];
			$data->conf_signature = $row["conf_signature"];
			$data->conf_currency_us = $row["conf_currency_us"];
			$data->conf_currency_bol = $row["conf_currency_bol"];
			
			return $data;
		}
		else{
			securityMasterUnlock(56,1,$sql);
			return false;
		}
	}
}
?>